package org.car.world.service.impl;

import java.util.List;

import org.car.world.core.entily.MerchantsTable;
import org.car.world.core.mapper.MerchantsTableMapper;
import org.car.world.service.MerchantsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;

@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class MerchantsServiceImpl implements MerchantsService {

    @Autowired
    MerchantsTableMapper merchantsTableMapper;

    @Override
    public int deleteByPrimaryKey(Integer merchantsId) {
        return merchantsTableMapper.deleteByPrimaryKey(merchantsId);
    }

    @Override
    public int insert(MerchantsTable record) {
        return merchantsTableMapper.insert(record);
    }

    @Override
    public MerchantsTable selectByPrimaryKey(Integer merchantsId) {
        return merchantsTableMapper.selectByPrimaryKey(merchantsId);
    }

    @Override
    public List<MerchantsTable> selectAll() {
        return merchantsTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(MerchantsTable record) {
        return merchantsTableMapper.updateByPrimaryKey(record);
    }

    @Override
    public MerchantsTable loginMerchants(String merchantsPhone, String merchantsShopname) {
        return merchantsTableMapper.loginMerchants(merchantsPhone, merchantsShopname);
    }

    @Override
    public List<MerchantsTable> selectLimit(Integer form, Integer size, Integer merchantsState) {
        PageHelper.startPage(form, size);
        return merchantsTableMapper.selectMatst(merchantsState);
    }


    @Override
    public List<MerchantsTable> selectMatst(Integer merchantsState) {
        return merchantsTableMapper.selectMatst(merchantsState);
    }

    @Override
    public int selectcount(Integer merchantsState) {
        return merchantsTableMapper.selectcount(merchantsState);
    }

    @Override
    public int merchantsupst(Integer merchantsId, Integer sta) {
        return merchantsTableMapper.merchantsupst(merchantsId, sta);
    }

    @Override
    public List<MerchantsTable> selectphone(String phone) {
        return merchantsTableMapper.selectphone(phone);
    }

    @Override
    public int updateByPrimaryShop(MerchantsTable record) {
        return merchantsTableMapper.updateByPrimaryShop(record);
    }

    @Override
    public boolean updateByPrimaryIdActiv(MerchantsTable record) {
        return merchantsTableMapper.updateByPrimaryIdActiv(record);
    }

    @Override
    public boolean updateByPrimaryBusi(MerchantsTable record) {
        return merchantsTableMapper.updateByPrimaryBusi(record);
    }

    @Override
    public int SelectByPrimaryKeyPwd(MerchantsTable record) {
        return merchantsTableMapper.SelectByPrimaryKeyPwd(record);
    }

    @Override
    public int updateByPrimaryPwd(MerchantsTable record) {
        return merchantsTableMapper.updateByPrimaryPwd(record);
    }

    @Override
    public int LoginPhonePwd(MerchantsTable record) {
        return merchantsTableMapper.LoginPhonePwd(record);
    }

}
